<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>jquery-ajax</title>
  <script src="../js/jquery.js"></script>
  <script>
    $(function () {
      var loginData = {
        username: 'admin1',
        password: '123321'
      }
      var token = '12313123123123'
      $.ajax({
        url: 'http://47.94.46.113:7788/user/login',
        method: 'post',
        data: JSON.stringify(loginData),
        headers: {
          'Content-Type': 'application/json',
          'Authorization': token
        },
        success: function (res) {
          console.log(res.data.token);
        },
        error: function (res) {
          alert(res.message)
        }
      })
      // 毒鸡汤请求
      // $.get('https://api.muxiaoguo.cn/api/dujitang',function(res) {
      //   console.log(res);
      // })
      // 获取QQ信息
      $.get('https://api.muxiaoguo.cn/api/QqInfo', { qq: 1024543289 }, function (res) {
        console.log(res);
      })
    })
  </script>
</head>

<body>

</body>

</html>